import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Main',
    component: () => import( '../views/Main.vue'),
    children:[
      {
        path: '/homepage',
        alias:'',
        name: 'HomePage',
        component: () => import( '../views/HomePage.vue')
      },
      {
        path: '/menu',
        name: 'Menu',
        component: () => import( '../views/Menu.vue')
      },
      {
        path: '/shopbag',
        name: 'ShopBag',
        component: () => import( '../views/ShopBag.vue')
      },
      {
        path: '/my',
        name: 'My',
        component: () => import( '../views/My.vue'),
      },
      {
        path: '/alllike',
        name: 'Alllike',
        component: () => import( '../views/Alllike.vue')
      }
    ]
  },
  
  {
    path: '/detail/:pid',
    name: 'Detail',
    component: () => import( '../views/Detail.vue'),
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import( '../views/Login.vue'),
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import( '../views/Register.vue'),
  },
  {
    path: '/checkout/',
    name: 'CheckOut',
    component: () => import( '../views/CheckOut.vue')
  },
  {
    path: '/person',
    name: 'Person',
    component: () => import( '../views/Person.vue')
  },
  {
    path: '/address',
    name: 'Address',
    component: () => import( '../views/Address.vue')
  },
  {
    path: '/newaddress',
    name: 'NewAddress',
    component: () => import( '../views/NewAddress.vue')
  },
  {
    path: '/editaddress/:aid',
    name: 'EditAddress',
    component: () => import( '../views/EditAddress.vue')
  },
  {
    path: '/center',
    name: 'Center',
    component: () => import( '../views/Center.vue')
  },
  {
    path: '/searchcode',
    name: 'SearchCode',
    component: () => import( '../views/SearchCode.vue')
  },
  {
    path: '/getnewcode',
    name: 'GetNewCode',
    component: () => import( '../views/GetNewCode.vue')
  },
  {
    path: '/myorder',
    name: 'MyOrder',
    component: () => import( '../views/MyOrder.vue')
  },
 
  
]

const router = new VueRouter({
  routes
})

export default router
